package Mundo;

import java.sql.DriverManager;

import com.mysql.jdbc.Connection;

public class ConexionMysql{
	
	Connection link = null;
    
    public String db = "cucutafa_InteligenciaDeNegocios";
    public String url = "jdbc:mysql://209.190.61.35/";
    public String user = "cucutafa";
    public String pass = "horacio22";
	


    public ConexionMysql(){

    }

    public Connection Conectar(){

        //Autenticacion

        try{
            //cargamos el Driver
            Class.forName("com.mysql.jdbc.Driver");
            // creamos un enlace
            System.out.println("EMPEZOOOOOOO");
            link = (Connection) DriverManager.getConnection(this.url+db, this.user, this.pass);
            System.out.println("Sirvio");
        }
        catch(Exception e){
        	System.out.println("PrmeraFalla");
           System.out.println(e.getMessage());
           System.out.println(e.getCause());
        }
        return link;
    }
    

    public Connection darLink()
    {
    	return link;
    }
    
    
    
    
}
